﻿@model ScrumProject.Models.Task

@{
    ViewBag.Title = "Create";
    int projectId = ViewBag.projectId;
}

<h2>Create new Task</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()){
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Task</legend>

        <table width="100%">
            <tr style="height:20px"></tr>
            <tr>
                <td align="center" valign="top">
                    <div class="editor-label">
                        <br />
                    </div>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.Description)
                    </div>
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.Description, new { rows = 10, cols = 40, name = "post", style = "width: 400px; height: 120px;" })
                    </div>
                    <div>
                        @Html.ValidationMessageFor(model => model.Description)
                    </div>                  
                </td>
            </tr>
            <tr>
                <td align="center" valign="top">
                    <div class="editor-label">
                        <br />
                    </div>
                    <div class="editor-label">
                        @Html.Label("User")
                        @*@Html.LabelFor(model => model.UserId)*@
                    </div>
                    <div class="editor-field">
                        @Html.DropDownListFor(m => m.UserId, new SelectList(new ScrumProject.Models.UserRepository().GetAllUsersOnProject(projectId), "Id", "Username"), "-- please select user --",new { style = "width: 400px" })
                    </div>                 
                </td>
            </tr>
            <tr>
                <td align="center" valign="top">
                    <div class="editor-label">
                        <br />
                    </div>
                    <div class="editor-label">
                        @Html.Label("Estimated work")
                        @*@Html.LabelFor(model => model.WorkRemaining)*@
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(model => model.WorkRemaining, new { style = "width: 400px" })
                    </div>
                    <div>
                        @Html.ValidationMessageFor(model => model.WorkRemaining)
                    </div>                  
                </td>
            </tr>
            <tr>
                <td>
                    <p>
                        <input type="submit" value="Create" name="submitButton" class="btn" id="btnSave"/>
                    </p>
                </td>
            </tr>
        </table>
    </fieldset>
}

